home *** CD-ROM | disk | FTP | other *** search
/ PC Open 92 / PC Open 92 CD 1.bin / DBNUOVO / ELABORA.JS < prev    next >
Encoding:
Text File  |  2003-06-17  |  1.2 KB  |  38 lines

  1.  
  2.  
  3. function Ricerca() {
  4.  
  5. var stringa = document.modulo.cerca.value.toUpperCase();
  6.    
  7.    if ((stringa == "") || (stringa == "undefined")) {
  8.      risultati.innerHTML = "Inserire un termine per eseguire una ricerca";
  9.      return false;
  10.     }
  11.    id_database.recordset.moveFirst();
  12.  
  13.    var estrai = "";
  14.  
  15.      while (!id_database.recordset.EOF) {
  16.        var title = id_database.recordset("Titolo").value.toUpperCase();
  17.          if (title.indexOf(stringa) >= 0) {
  18.            estrai += "<div><b><font face=arial  color=#094673 size=2>" + id_database.recordset("Titolo")
  19.             + "</b></font>"
  20.             + "</a><br><b>Argomento:</b>" + id_database.recordset("Argomento") 
  21.             + "</a><br><b>Anno:</b>" + id_database.recordset("Anno") 
  22.             + "</a><br><b>Mese:</b>" + id_database.recordset("Mese") 
  23.             + "</a><br><b>Pagina:</b>" + id_database.recordset("Pagina") 
  24.             + "</div><br>";
  25.           }
  26.          id_database.recordset.moveNext();
  27.       }
  28.  
  29.      if ((estrai == "") || (estrai == "undefined")) {
  30.        risultati.innerHTML = "Nessun risultato per la ricerca";
  31.        return false;
  32.       }
  33.      else {
  34.        risultati.innerHTML = estrai;
  35.       }
  36.  
  37.